package com.pastquestion;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main10b {

	public static void main(String[] args) {
		List<String> list = new ArrayList();
		Scanner scan = new Scanner(System.in);
		String str = scan.nextLine();
		for (int i = 0; i < str.length(); i++) {
			for (int j = i; j < str.length(); j++) {
				String a = str.substring(i, j+1);
				if(!list.contains(a))
					list.add(a);
			}
		}
		System.out.println(list.size());
	}

}
